RightMargin Property

       

Returns or sets the right margin for the text in a RichTextBox control.

Syntax

object.RightMargin [ = value]

The RightMargin property syntax has these parts:

Part Description
object An object expression that evaluates to a RichTextBox control.
value A numeric expression specifying the indent in twips from the right edge of the text to the right edge of the control, as described below.

Remarks

The RightMargin property is used to set the right most limit for text wrapping, centering, and indentation. Centering a paragraph is based on the left most part of the text portion(doesn't include borders) of the RichTextBox control and the RightMargin property. Also, when setting the SelRightIndent property, it will be based on the current setting of the RightMargin property.

The default for the RightMargin property is 0 and will cause the control to set text wrapping equal to the right most part of the RichTextBox control so all text is viewable.

Note   When calculating a value for the RightMargin property, you must take in to account the width of the borders of the RichTextBox control if BorderStyle is set to rtfFixedSingle.